Add Fields to the Rowset Object

Once you have a Rowset object, you need to define fields for the Rowset. These fields act as the virtual database fields. The field names you specify must match the field names specified in the data definition file. For more information on data definition files, see Creating Data Definition Files.

Fields are added to a CDO Rowset using the AddField method:

CDOSet.AddField "Order ID", vbString
CDOSet.AddField "Company Name", vbString
CDOSet.AddField "Order Date", vbDate
CDOSet.AddField "Order Amount", vbCurrency

This code adds four fields to the Rowset with the specified field names, and field types. The field types are based on constant values for the Variant data type. The constant names used here are from Visual Basic. For information on valid constant values, see the AddField method in the Crystal Data Source Object Models.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com